<HTML><HEAD><TITLE>writeclause(?Clause)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Term I/O</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>writeclause(?Clause)</H1>
The clause Clause is pretty printed on the current output .


<DL>
<DT><EM>Clause</EM></DT>
<DD>A Prolog term.
</DD>
</DL>
<H2>Description</H2>
   Used to pretty print the clause Clause on the current output according
   to the current operator declarations.

<P>
   When reading Prolog clauses from one file, and then writing to the
   current output, the latter part can be done using writeclause/1.  This
   is because the clauses are terminated by a period and a newline, which
   are not retained by Prolog.  writeclause/1 replaces these, and flushes
   the output.

<P>
   writeclause/1,2 knows about the special meaning of ,/2, ;/2, -&gt;/2, fg,
   --&gt;/2 and :-/2 and prints the clause with the appropriate indentation of
   subgoals and some (redundant) parentheses to show the clause structure.
   Everything else is written as with writeq/1,2, so output of writeclause/1,2
   is readable for read/1,2.
<P>

<H3>Modes and Determinism</H3><UL>
<LI>writeclause(?) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H2>Examples</H2>
<PRE>
	Equivalent to writeclause(output, Term).  (see writeclause/2 for details).
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/ioterm/writeq-1.html">writeq / 1</A>, <A HREF="../../kernel/ioterm/writeclause-2.html">writeclause / 2</A>
</BODY></HTML>
